[XAML] datatrigger

Posted by Bert on Stack Overflow See other posts from Stack Overflow or by Bert
Published on 2010-03-13T11:12:14Z Indexed on 2010/03/13 11:15 UTC
Read the original article Hit count: 473

Filed under:

Hi,

I have a UserControl in XAML with a couple of buttons....

When the "VideoEnable" property in my C# code change to true i want to change the color of a button.

The following code compiles but crashes and I cant find a right solution

<UserControl.Triggers>
    <DataTrigger Binding="{Binding VideoEnable}" Value="true">
        <Setter Property="Button.Background" Value="Green" TargetName="VideoButton" />
        <Setter Property="Grid.Background" Value="Blue" TargetName="videoGrid" />
    </DataTrigger>
</UserControl.Triggers>

© Stack Overflow or respective owner

Related posts about xaml